<template>
  <div class="new">
    <h3 class="title">新人管理</h3>
    <el-form :inline="true" :model="newForm" class="demo-form-inline">
      <el-form-item>
        <el-input v-model="newForm.username" placeholder="新人姓名"></el-input>
      </el-form-item>
      <el-form-item>
        <el-input v-model="newForm.phone" placeholder="新人手机号"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="onSubmit">查询</el-button>
      </el-form-item>
    </el-form>
    <p>共检索<span>25</span>条记录</p>
    <el-table :data="newData" border style="width: 100%">
      <el-table-column prop="pid" label="编号" width="100"> </el-table-column>
      <el-table-column prop="pname" label="姓名" width="200"> </el-table-column>
      <el-table-column prop="pphone" label="手机号" width="200">
      </el-table-column>
      <el-table-column prop="pmail" label="邮箱" width="200"> </el-table-column>
      <el-table-column prop="regdate" label="注册时间"> </el-table-column>
      <el-table-column prop="status" label="账号状态" width="120">
      </el-table-column>
      <el-table-column label="操作">
        <el-button @click="stopNew">账号禁用</el-button>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import api from "../../api";
export default {
  name: "NewAdmain",
  data() {
    return {
      newForm: {
        username: "",
        phone: "",
      },
      newData: [],
    };
  },
  methods: {
    http() {
      api.selectPerson().then((res) => {
        if (res.status === 200) {
          this.newData = res.data;
        }
      });
    },
    onSubmit() {},
    stopNew() {
      console.log("禁用");
    },
  },
  mounted() {
    this.http();
  },
};
</script>

<style lang="less" scoped>
.new {
  margin-left: 20px;
  .title {
    text-align: center;
    padding: 20px;
    background-color: #c4b4a9;
    margin-bottom: 10px;
  }
}
</style>